<% form_tag( { :controller => "content", :action => "manage_article", :id => params[:id], :page => params[:page] }, :method => "post") do %>
<table id="table_content_list" frame="border" border=1 cellpadding="5">
  <tbody>
   <% if @contents.length > 0 %>
	<th>No.</th>
	<th>Title</th>
	<th>Body</th>
	<th>Category</th>
	<th>Created Date</th>
	<th>Last Version Date</th>
	<th>Status</th>		
	<th>Status Update Date</th>
	<th></th>
   <%else%>
    <tr><td valign="center" align="center">No Articles created yet!</td><tr>
   <%end%>
	<% if params[:page] %>
		<% @iID = ((params[:page].to_i - 1) * @items_per_page)  %>
	<% else %>
		<% @iID = 0 %>
	<% end %>
	<% for @content in @contents%>
		<% content_tag_for(:tr, @content) do %>
			<% @iID = @iID + 1 %>
			<td><%=h @iID %></td>
			<td><%=h @content.title %></td>
			<td><%=h @content.body[0,49] %></td>
			<td><%=h @content.categoryname %></td>
			<td><%=h @content.createdate.to_datetime.strftime('%Y-%m-%d %H:%M:%S') %></td>
			<td><%=h @content.last_version.to_datetime.strftime('%Y-%m-%d %H:%M:%S') %></td>
			<td><%=h @content.editorial_status %></td>
			<td>
				<% if !@content.editorial_status_date.nil? %>
					<%=h @content.editorial_status_date.to_datetime.strftime('%Y-%m-%d %H:%M:%S') %>
				<% end %>
			</td>
			<td>
				<%= link_to "Edit", :action => "manage_article", :id => params[:id], :page => params[:page], :content_version_id => @content.content_version_id, :case => "Edit" %>
				<%= link_to "Delete", :action => "manage_article", :id => params[:id], :page => params[:page], :content_version_id => @content.content_version_id, :case => "Delete" %>
			</td>	
		<% end %>
	<% end %>
  </tbody>
</table>
<% end %>
